package com.kehutong.wxapi.response;

import org.coraframework.json.annotation.JSONField;

import java.util.List;

/**
 * 获取第三方扫码登录用户信息响应对象
 * @author: liukunlong
 * @date: 2021-03-31 14:12
 */
public class GetLoginInfoResponse {

    /**
     * errcode
     */ /**
     * errcode : 0
     * errmsg : ok
     * usertype : 1
     * user_info : {"userid":"xxxx","open_userid":"xxx","name":"xxxx","avatar":"xxxx"}
     * corp_info : {"corpid":"wxCorpId"}
     * agent : [{"agentid":0,"auth_type":1},{"agentid":1,"auth_type":1},{"agentid":2,"auth_type":1}]
     * auth_info : {"department":[{"id":2,"writable":true}]}
     */

    @JSONField(name = "errcode")
    private Integer errcode;
    /**
     * errmsg
     */
    @JSONField(name = "errmsg")
    private String errmsg;
    /**
     * usertype
     */
    @JSONField(name = "usertype")
    private Integer usertype;
    /**
     * userInfo
     */
    @JSONField(name = "user_info")
    private UserInfoDTO userInfo;
    /**
     * corpInfo
     */
    @JSONField(name = "corp_info")
    private CorpInfoDTO corpInfo;
    /**
     * agent
     */
    @JSONField(name = "agent")
    private List<AgentDTO> agent;
    /**
     * authInfo
     */
    @JSONField(name = "auth_info")
    private AuthInfoDTO authInfo;

    public Integer getErrcode() {
        return errcode;
    }

    public void setErrcode(Integer errcode) {
        this.errcode = errcode;
    }

    public String getErrmsg() {
        return errmsg;
    }

    public void setErrmsg(String errmsg) {
        this.errmsg = errmsg;
    }

    public Integer getUsertype() {
        return usertype;
    }

    public void setUsertype(Integer usertype) {
        this.usertype = usertype;
    }

    public UserInfoDTO getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(UserInfoDTO userInfo) {
        this.userInfo = userInfo;
    }

    public CorpInfoDTO getCorpInfo() {
        return corpInfo;
    }

    public void setCorpInfo(CorpInfoDTO corpInfo) {
        this.corpInfo = corpInfo;
    }

    public List<AgentDTO> getAgent() {
        return agent;
    }

    public void setAgent(List<AgentDTO> agent) {
        this.agent = agent;
    }

    public AuthInfoDTO getAuthInfo() {
        return authInfo;
    }

    public void setAuthInfo(AuthInfoDTO authInfo) {
        this.authInfo = authInfo;
    }

    public static class UserInfoDTO {
        /**
         * userid
         */ /**
         * userid : xxxx
         * open_userid : xxx
         * name : xxxx
         * avatar : xxxx
         */

        @JSONField(name = "userid")
        private String userid;
        /**
         * openUserid
         */
        @JSONField(name = "open_userid")
        private String openUserid;
        /**
         * name
         */
        @JSONField(name = "name")
        private String name;
        /**
         * avatar
         */
        @JSONField(name = "avatar")
        private String avatar;

        public String getUserid() {
            return userid;
        }

        public void setUserid(String userid) {
            this.userid = userid;
        }

        public String getOpenUserid() {
            return openUserid;
        }

        public void setOpenUserid(String openUserid) {
            this.openUserid = openUserid;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getAvatar() {
            return avatar;
        }

        public void setAvatar(String avatar) {
            this.avatar = avatar;
        }
    }

    public static class CorpInfoDTO {
        /**
         * corpid
         */ /**
         * corpid : wxCorpId
         */

        @JSONField(name = "corpid")
        private String corpid;

        public String getCorpid() {
            return corpid;
        }

        public void setCorpid(String corpid) {
            this.corpid = corpid;
        }
    }

    public static class AuthInfoDTO {
        /**
         * department
         */
        @JSONField(name = "department")
        private List<DepartmentDTO> department;

        public List<DepartmentDTO> getDepartment() {
            return department;
        }

        public void setDepartment(List<DepartmentDTO> department) {
            this.department = department;
        }

        public static class DepartmentDTO {
            /**
             * id
             */ /**
             * id : 2
             * writable : true
             */

            @JSONField(name = "id")
            private Integer id;
            /**
             * writable
             */
            @JSONField(name = "writable")
            private Boolean writable;

            public Integer getId() {
                return id;
            }

            public void setId(Integer id) {
                this.id = id;
            }

            public Boolean getWritable() {
                return writable;
            }

            public void setWritable(Boolean writable) {
                this.writable = writable;
            }
        }
    }

    public static class AgentDTO {
        /**
         * agentid
         */ /**
         * agentid : 0
         * auth_type : 1
         */

        @JSONField(name = "agentid")
        private Integer agentid;
        /**
         * authType
         */
        @JSONField(name = "auth_type")
        private Integer authType;

        public Integer getAgentid() {
            return agentid;
        }

        public void setAgentid(Integer agentid) {
            this.agentid = agentid;
        }

        public Integer getAuthType() {
            return authType;
        }

        public void setAuthType(Integer authType) {
            this.authType = authType;
        }
    }
}
